package com.cole.gx095.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
@Table(name = "purchasecontract")
public class Purchasecontract {

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private int id;

    @Column(name = "Type")
    private String type;

    @Column(name = "ContractNum")
    private String contractNum;
    
    @Column(name = "ContractDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date contractDate;
    /**
     * 供应商
     */
    @Column(name = "Supplier")
    private String supplier;
    
    @Column(name = "ContractAmount")
    private Double contractAmount;
    
    @Column(name = "AttachCount")
    private Integer attachCount;
    
    @Column(name = "UpdateCount")
    private Integer updateCount;
    
    @Column(name = "CreateAdminTrueName")
    private String createAdminTrueName;
    
    @CreatedDate
    @Column(name = "CreateDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date createDate;
    
    @Column(name = "BillCount")
    private Integer billCount;
    
    @Column(name = "BillAmount")
    private Double billAmount;
    
    @Column(name = "BillStatus")
    private Integer billStatus;
    
    @Column(name = "Remarks")
    private String remarks;
//
//    public int getId() {
//        return id;
//    }
//
//    public void setId(int id) {
//        this.id = id;
//    }
//
//    public String getType() {
//        return type;
//    }
//
//    public void setType(String type) {
//        this.type = type;
//    }
//
//    public String getContractNum() {
//        return contractNum;
//    }
//
//    public void setContractNum(String contractNum) {
//        this.contractNum = contractNum;
//    }
//
//    public String getSupplier() {
//        return supplier;
//    }
//
//    public void setSupplier(String supplier) {
//        this.supplier = supplier;
//    }
//
//    public Double getContractAmount() {
//        return contractAmount;
//    }
//
//    public void setContractAmount(Double contractAmount) {
//        this.contractAmount = contractAmount;
//    }
//
//    public Integer getAttachCount() {
//        return attachCount;
//    }
//
//    public void setAttachCount(Integer attachCount) {
//        this.attachCount = attachCount;
//    }
//
//    public Integer getUpdateCount() {
//        return updateCount;
//    }
//
//    public void setUpdateCount(Integer updateCount) {
//        this.updateCount = updateCount;
//    }
//
//    public String getCreateAdminTrueName() {
//        return createAdminTrueName;
//    }
//
//    public void setCreateAdminTrueName(String createAdminTrueName) {
//        this.createAdminTrueName = createAdminTrueName;
//    }
//
//    public Date getCreateDate() {
//        return createDate;
//    }
//
//    public void setCreateDate(Date createDate) {
//        this.createDate = createDate;
//    }
//
//    public Integer getBillCount() {
//        return billCount;
//    }
//
//    public void setBillCount(Integer billCount) {
//        this.billCount = billCount;
//    }
//
//    public Double getBillAmount() {
//        return billAmount;
//    }
//
//    public void setBillAmount(Double billAmount) {
//        this.billAmount = billAmount;
//    }
//
//    public Integer getBillStatus() {
//        return billStatus;
//    }
//
//    public void setBillStatus(Integer billStatus) {
//        this.billStatus = billStatus;
//    }
//
//    public String getRemarks() {
//        return remarks;
//    }
//
//    public void setRemarks(String remarks) {
//        this.remarks = remarks;
//    }
//
//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null || getClass() != o.getClass()) return false;
//        Purchasecontract that = (Purchasecontract) o;
//        return id == that.id && Objects.equals(type, that.type) && Objects.equals(contractNum, that.contractNum) && Objects.equals(contractDate, that.contractDate) && Objects.equals(supplier, that.supplier) && Objects.equals(contractAmount, that.contractAmount) && Objects.equals(attachCount, that.attachCount) && Objects.equals(updateCount, that.updateCount) && Objects.equals(createAdminTrueName, that.createAdminTrueName) && Objects.equals(createDate, that.createDate) && Objects.equals(billCount, that.billCount) && Objects.equals(billAmount, that.billAmount) && Objects.equals(billStatus, that.billStatus) && Objects.equals(remarks, that.remarks);
//    }
//
//    @Override
//    public int hashCode() {
//        return Objects.hash(id, type, contractNum, contractDate, supplier, contractAmount, attachCount, updateCount, createAdminTrueName, createDate, billCount, billAmount, billStatus, remarks);
//    }
}
